//
//  player.m
//  pigandfish
//
//  Created by jiatuu jiang on 12-1-28.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "player.h"
#import "ocean.h"


@implementation player



+(void)goplay
{
    CGSize winSize = [[CCDirector sharedDirector] winSize];
    CCDirector *director = [CCDirector sharedDirector];
    CCScene *newScene = [CCScene node];
    CCLayer *layer = [player node];
    
    
    CCLabelTTF *title = [CCLabelTTF labelWithString:@"hahaha1" fontName:@"Marker Felt" fontSize:48];
    
    //title.color= ccc3(255, 255, 255);
    title.position = ccp (160,80);
    
    //BUTTON MAKE
    CCMenuItem *leftupbutton = [CCMenuItemImage itemFromNormalImage:@"ButtonPlus.png" selectedImage:@"ButtonMinus.png" target:self selector:@selector(leftup:)];
    //CCMenuItem *leftupbutton=[CCMenuItemFont itemFromString:@"go" target:self selector:@selector(leftup:)];
    leftupbutton.position=ccp(0+leftupbutton.contentSize.width,winSize.height/5*2);
    
    CCMenuItem *leftdownbutton = [CCMenuItemImage itemFromNormalImage:@"ButtonMinus.png" selectedImage:@"ButtonPlus.png" target:self selector:@selector(leftdown:)];
    leftdownbutton.position=ccp(0+leftupbutton.contentSize.width,leftupbutton.position.y-leftupbutton.contentSize.height);
    
    CCMenuItem *rightupbutton = [CCMenuItemImage itemFromNormalImage:@"ButtonPlus.png" selectedImage:@"ButtonMinus.png" target:self selector:@selector(rightup:)];
    rightupbutton.position=ccp(winSize.width-leftupbutton.contentSize.width,winSize.height/5*2);
    
    CCMenuItem *rightdownbutton = [CCMenuItemImage itemFromNormalImage:@"ButtonMinus.png" selectedImage:@"ButtonPlus.png" target:self selector:@selector(rightdown:)];
    rightdownbutton.position=ccp(winSize.width-leftupbutton.contentSize.width,leftupbutton.position.y-leftupbutton.contentSize.height);
    
    //MENU MAKE
    CCMenu *menu = [CCMenu menuWithItems:leftupbutton,leftdownbutton, rightupbutton,rightdownbutton,nil];
    menu.position = CGPointZero;
    //[layer addChild:menu];
    
    //make background
    //map *tmap =[map node];
    //[newScene addChild:tmap];

    //add background
    CCLayer *oceanlayer=[ocean node];
                    
    [layer addChild:oceanlayer];
    [newScene addChild:layer];
    [director runWithScene:newScene];
}

+(void)leftup:(id)sender{
    NSLog(@"leftup");
}

+(void)leftdown:(id)sender{
    NSLog(@"leftdown");
}

+(void)rightup:(id)sender{
    NSLog(@"rightup");
}

+(void)rightdown:(id)sender{
    NSLog(@"rightdown");
}

-(void)dealloc{

    [super dealloc];
}

@end
